Fix default read of boolean opts with '1' as the default.
authorrobertlipe <robertlipe@gmail.com>
Fri, 3 Jan 2014 05:29:49 +0000 (05:29 +0000)
committerrobertlipe <robertlipe@gmail.com>
Fri, 3 Jan 2014 05:29:49 +0000 (05:29 +0000)
gpsbabel/gui/format.h

index 8c1dead625f3c6f6c5bdbc1978fac46f0b3f2813..65d93e6352c228b1566e9a8500f4a324dfe141da 100644 (file)
@@ -58,7 +58,13 @@ public:
       defaultValue_(defaultValue), minValue_(minValue), maxValue_(maxValue), html_(html)
   {
     value_ = QVariant();
-    isSelected_ = false;
+    // Boolean values pay more atention to 'selected' than value.  Make 
+    // them match here. For non-bools, just make them unchecked.
+    if (type_ == OPTbool && defaultValue.toBool() == true) {
+      isSelected_ = true;
+    } else {
+      isSelected_ = false;
+    }
   }
 
   FormatOption(const FormatOption & c)